{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set menu = 'admin_coin_settings' %}
{% set script_controller = "coin/range" %}

{% block main %}

  {{ web_macro.flash_messages() }}
  <form class="form-horizontal" method="post" id="coin-settings-form">
  

      <style type="text/css">
      .popover{
        z-index: 9999;
            }
        </style>
        <span class="glyphicon glyphicon-question-sign text-muted pull-right" id="article-property-tips" data-toggle="tooltip" data-placement="bottom" href="javascript:" title="" data-original-title=""></span> 
         <div id="article-property-tips-html" style="display:none;">
            <div style="width:250px;font-size:14px;">
              <span style="color:blue;"> 说明：</span><br>
              虚拟币是可以在网校内进行支付消费的虚拟货币<br>
              <span style="color:blue;">推广建议：</span><br>
              1、 建议网校使用虚拟币对网校内课程进行标价；<br>
              2、 网校可鼓励{% if setting('default.user_name') %}{{setting('default.user_name')|default('学员')}}{% else %}学员{% endif %}充值，可提升用户忠诚度；<br>
              3、 建议配合使用学习卡（商业应用），给予一定优惠；<br>
            </div>
        </div>

      <div class="form-group">
    		<div class="col-md-3 control-label">
    			<label for="coin_name">虚拟币名称</label>
    		</div>
    		<div class="controls col-md-4">
    			<input type="text" id="coin_name" name="coin_name" class="form-control" value="{{coin_settings_posted.coin_name}}">
    		</div>
      </div>

      <div class="row form-group">
        <div class="col-md-3 control-label">
          <label for="coin_picture">虚拟币图片</label>
        </div>
        <div class="col-md-7 controls">
        <div >

          <div id="coin-picture-largeSize" style="display:inline;">{% if setting('coin.coin_picture') %}<img src="{{ asset(setting('coin.coin_picture')) }}">{% endif %}</div>
          <div id="coin-picture-middleSize" style="display:none;">{% if setting('coin.coin_picture_30_30') %}<img src="{{ asset(setting('coin.coin_picture_30_30')) }}">{% endif %}</div>
          <div id="coin-picture-smallSize" style="display:none;">{% if setting('coin.coin_picture_20_20') %}<img src="{{ asset(setting('coin.coin_picture_20_20')) }}">{% endif %}</div>
          <div id="coin-picture-extraSmallSize" style="display:none;">{% if setting('coin.coin_picture_10_10') %}<img src="{{ asset(setting('coin.coin_picture_10_10')) }}">{% endif %}</div>
        </div></br>

          <button class="btn btn-default btn-sm" id="coin-picture-upload" type="button" data-url="{{ path('admin_coin_picture') }}">上传</button>
          <button class="btn btn-default btn-sm" id="coin-picture-remove" type="button" data-url="{{ path('admin_coin_picture_remove') }}" {% if not setting('coin.coin_picture') %}style="display:none;"{% endif %}>删除</button>
          <p class="help-block">
          请上传png, gif, jpg格式的超过50*50的等比例图片，否则无法上传
          </p>
          <input type="hidden" name="coin_picture" value="{{setting('coin.coin_picture') }}">
          <input type="hidden" name="coin_picture_50_50" value="{{setting('coin.coin_picture_50_50') }}">
          <input type="hidden" name="coin_picture_30_30" value="{{setting('coin.coin_picture_30_30') }}">
          <input type="hidden" name="coin_picture_20_20" value="{{setting('coin.coin_picture_20_20') }}">
          <input type="hidden" name="coin_picture_10_10" value="{{setting('coin.coin_picture_10_10') }}">
          <input type="hidden" name="cash_rate" {% if setting('coin.cash_rate') %} value="{{setting('coin.cash_rate') }}" {% else %} value="1" {% endif %}>
          <input type="hidden" name="coin_enabled" {% if setting('coin.coin_enabled') %} value="{{setting('coin.coin_enabled') }}" {% else %} value="0" {% endif %}>
          <input type="hidden" name="cash_model" {% if setting('coin.cash_model') %} value="{{setting('coin.cash_model') }}" {% else %} value="none" {% endif %}>
          <input type="hidden" name="charge_coin_enabled" {% if setting('coin.charge_coin_enabled') %} value="{{setting('coin.charge_coin_enabled')}}" {% else %} value="0" {% endif %}>
        </div>
    </div>

        <div class="form-group">
              <div class="col-md-3 control-label">
                <label for="coin_content">虚拟币说明</label>
              </div>
          <div class="controls col-md-8">
            <textarea class="form-control" id="coin_content" rows="16" name="coin_content" value="{{coin_settings_posted.coin_content}}" data-image-upload-url="{{ path('editor_upload', {token:upload_token('default')}) }}">{{ field_value(coin_settings_posted, 'coin_content') }}</textarea>
            <p class="help-block">虚拟币说明可用于描述虚拟币特点，用途，获得的途径等虚拟币的相关内容
            </p>
          </div>
        </div> 

    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

    <div class="row form-group">
    	<div class="controls col-md-offset-3 col-md-8">
    		<button type="submit" class="btn btn-primary" >提交更新</button>
    	</div>
    </div>
  </form>
{% endblock %}